function query() {
        delayRun(500, null, function(){
            http.get("/examp.json?t=a", {}, queryResult)
        })
}

function queryResult(json) {
    if (json.error) {
        dialog.toast(json.error.description)
    }

    exampsData = json.examps
    currentChanged()
}

function currentChanged() {
    model.clear()
    exampsData.forEach(function(e){
        var date = e.examp[buttonGroup.checkedButton.index]
        var i = buttonGroup.checkedButton.index
        var next = nextExamp(e.examp)

        if ( date !== "") {
            http.get("/member.json?t=q", {id: e.id}, function(json){
                if (json.error) {
                    dialog.toast(json.description)
                    return
                }
                json.nextExamp =next
                model.append(json)
            })
        }
    })
}

function nextExamp(examp) {
    var list = ["", "二", "三", "四"]
    for (var i = buttonGroup.checkedButton.index; i < 4; i++) {
         var date = examp[i]
        if (date !== "") {
            continue
        }
        return "下次进行科目" + list[i] + "考试"

    }

    return "考试已经完成"
}
